<template>
  <div>
    <el-tabs type="border-card" stretch>
      <el-tab-pane label="未就诊">
        <el-table :data="pageResult.records" border style="width: 100%">
                    <el-table-column
                            fixed
                            label="编号">
                            <template slot-scope="scope">
                            {{scope.row.registrationNumber}}
                            </template>
                    </el-table-column>
                    <el-table-column
                            label="患者姓名">
                            <template slot-scope="scope">
                            {{scope.row.patientEntity.name}}
                            </template>
                    </el-table-column>
                    <el-table-column
                            label="性别">
                            <template slot-scope="scope" >
                            {{scope.row.patientEntity.sex==1?'男':scope.row.patientEntity.sex==2?'女':'人妖'}}
                            </template>
                    </el-table-column>
                    <el-table-column
                            label="电话">
                            <template slot-scope="scope">
                            {{scope.row.patientEntity.mobile}}
                            </template>
                    </el-table-column>
                    <el-table-column
                            prop="createTime"
                            label="挂号时间">
                    </el-table-column>
                    <el-table-column
                            label="挂号类型">
                            <template slot-scope="scope" >
                            {{scope.row.hisRegisteredfeeEntity.registeredfeeName}}
                            </template>
                    </el-table-column>
                </el-table>
                <el-footer class="case-exam-footer">
                <el-pagination
                        background
                        layout="prev, pager, next"
                        :total="pageResult.total"
                        :page-size="pageResult.size"
                        class="pagination"
                        @current-change="handleIndexChange">
                </el-pagination>
                </el-footer>
      </el-tab-pane>
      <el-tab-pane label="已就诊">
        <el-table :data="pageResult1" border style="width: 100%">
                    <el-table-column
                            fixed
                            prop="registration_id"
                            label="编号">
                    </el-table-column>
                    <el-table-column
                            prop="name"
                            label="患者姓名">
                    </el-table-column>
                    <el-table-column
                            prop="sex"
                            label="性别">
                    </el-table-column>
                    <el-table-column
                            prop="age"
                            label="年龄">
                    </el-table-column>
                    <el-table-column
                            prop="mobile"
                            label="电话">
                    </el-table-column>
                    <el-table-column
                            prop="update_time"
                            label="就诊时间">
                    </el-table-column>
                    <el-table-column
                            prop="registration_status"
                            label="挂号类型">
                    </el-table-column>
                </el-table>
      </el-tab-pane>
    </el-tabs>
  </div>
</template>

<script>
import HisRegistration from "../../model/mfy/HisRegistration.js";
const hisRegistration = HisRegistration.getInstance();

export default {
  data(){
    return{
      tabPosition:'未就诊',     //设置页面初始值
      params:{},     //高级查询参数对象
      params1:{},     //高级查询参数对象
      pageResult:[], //page对象
      pageResult1:[], //page对象
    }
  },
  created() {
    this.list();
  },
  methods:{
    list() {
      hisRegistration.list2(this.params).then((response) => {
        this.pageResult = response.data.page;
      });
    },
    handleIndexChange(index){
      this.params.page = index
      this.list()
    },
    search(){
      this.params.page=1
      this.list()
    },
//     statusFormatter(row) {
//       if (row.registrationStatus == '1') {
//         return "待就诊";
//       }
//       if (row.registrationStatus == '2') {
//         return "已就诊";
//       }
//       if (row.registrationStatus == '3') {
//         return "已退号";
//       }
//       if (row.registrationStatus == '4') {
//         return "作废";
//       }
//       if (row.registrationStatus == '5') {
//         return "未付款";
//       }
//       if (row.registrationStatus == '6') {
//         return "部分支付";
//       }
//     },
  }
}
</script>